package com.orafl.use.comorafluse.applicationListenerEventDemo;

import com.orafl.use.comorafluse.ComOraflUseApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Set;

@SpringBootApplication
public class MainApplicationDemo {

    public static void main(String[] args) {
        ConfigurableApplicationContext context =  new SpringApplication(MainApplicationDemo.class).run(args);
        //发布事件
        context.publishEvent(new MultcatApplicationEvent("123"));
        context.publishEvent(new OraflApplicationEvent("我是一个字符串"));
        context.close();
    }
}
